<?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');

/**
 * Library class encapsulating navigation providing navigation methods.
 * @author 	Dean Gleeson <dean.gleeson@pragmaticsystems.com.au>
 * @date	14/12/2012
*/
class Navigation
{
	var $ci;
	
	var $menu_config_home = array('active','','','','','','','','');
	var $menu_config_selling = array('','active','','','','','','','');
	var $menu_config_buying = array('','','active','','','','','','');
	var $menu_config_landlord = array('','','','active','','','','','');
	var $menu_config_tenant = array('','','','','active','','','','');
	var $menu_config_offices = array('','','','','','active','','','');
	var $menu_config_finance = array('','','','','','','active','','');
	var $menu_config_aboutus = array('','','','','','','','active','');
	var $menu_config_contactus = array('','','','','','','','','active');
	var $menu_config_calculator = array('','','','','','','','','','active');
	
	function __construct()
	{
		$this->ci =& get_instance();
		$this->ci->load->library('template');
	}

	public function loadHomeView($data = array())
	{
		$data['menu_config'] = $this->menu_config_home;
		$this->ci->template->load('default', 'home', $data);
	}
	public function loadNewsLatestView($data = array())
	{
		$data['menu_config'] = $this->menu_config_home;
		$this->ci->template->load('default', 'news/latest', $data);
	}
	
	public function loadNewsItemView($data = array())
	{
		$data['menu_config'] = $this->menu_config_home;
		$this->ci->template->load('default', 'news/item', $data);
	}
	
	public function loadSellingWithGoGeckoView($data = array())
	{
		$data['menu_config'] = $this->menu_config_selling;
		$this->ci->template->load('default', 'selling/gogecko', $data);
	}
	
	public function loadPropertiesSoldView($data = array())
	{
		$data['menu_config'] = $this->menu_config_selling;
		$this->ci->template->load('default', 'property/listings', $data);
	}
        public function loadPropertiesAroundView($data = array())
	{
		$data['menu_config'] = $this->menu_config_selling;
		$this->ci->template->load('default', 'selling/around_suburbs', $data);
	}
	
	public function loadSalesAppraisalView($data = array())
	{
		$data['menu_config'] = $this->menu_config_selling;
		$this->ci->template->load('default', 'selling/appraisal', $data);
	}
	
	public function loadPresentingYourPropertyView($data = array())
	{
		$data['menu_config'] = $this->menu_config_selling;
		$this->ci->template->load('default', 'selling/presenting', $data);
	}
	
	public function loadListingsView($data = array())
	{
		$data['menu_config'] = $this->menu_config_buying;
		$this->ci->template->load('default', 'property/listings', $data);
	}
        
	public function loadHouseView($data = array())
	{
		$data['menu_config'] = $this->menu_config_buying;
		$this->ci->template->load('default', 'buying/house', $data);
	}
	
	public function loadPropertyManagementView($data = array())
	{
		$data['menu_config'] = $this->menu_config_landlord;
		$this->ci->template->load('default', 'landlord/propertymanagement', $data);
	}
	
	public function loadRentalAppraisalView($data = array())
	{
		$data['menu_config'] = $this->menu_config_landlord;
		$this->ci->template->load('default', 'landlord/appraisal', $data);
	}
	
	public function loadPropertiesForRentView($data = array())
	{
		$data['menu_config'] = $this->menu_config_tenant;
		$this->ci->template->load('default', 'property/listings', $data);
	}
	
	public function loadPropertiesLeasedView($data = array())
	{
		$data['menu_config'] = $this->menu_config_tenant;
		$this->ci->template->load('default', 'property/listings', $data);
	}
	
	public function loadMaintenanceRequestView($data = array())
	{
		$data['menu_config'] = $this->menu_config_tenant;
		$this->ci->template->load('default', 'tenant/maintenance', $data);
	}
	
	public function loadTenantInformationView($data = array())
	{
		$data['menu_config'] = $this->menu_config_tenant;
		$this->ci->template->load('default', 'tenant/information', $data);
	}
	
	public function loadFindOfficesView($data = array())
	{
		$data['menu_config'] = $this->menu_config_offices;
		$this->ci->template->load('default', 'offices/find', $data);
	}
	
	public function loadOfficeView($data = array())
	{
		$data['menu_config'] = $this->menu_config_offices;
		$this->ci->template->load('default', 'offices/office', $data);
	}
        
	public function loadOfficeTeamView($data = array())
	{
		$data['menu_config'] = $this->menu_config_offices;
		$this->ci->template->load('default', 'offices/team', $data);
	}
	
	public function loadOfficeTestimonialView($data = array())
	{
		$data['menu_config'] = $this->menu_config_offices;
		$this->ci->template->load('default', 'offices/testimonial', $data);
	}
	
	public function loadFinanceView($data = array())
	{
		$data['menu_config'] = $this->menu_config_finance;
		$this->ci->template->load('default', 'finance', $data);
	}
	
	public function loadAboutUsView($data = array())
	{
		$data['menu_config'] = $this->menu_config_aboutus;
		$this->ci->template->load('default', 'aboutus', $data);
	}

	public function loadContactUsView($data = array())
	{
		$data['menu_config'] = $this->menu_config_contactus;
		$this->ci->template->load('default', 'contactus', $data);
	}
        
        public function loadCalculatorView($data = array())
	{
		//$data['menu_config'] = $this->$menu_config_calculator;
		$this->ci->template->load('default', 'calculator', $data);
	}
    
    public function loadPropertyView($data = array(), $status='listings')
	{
        $menu='menu_config_home';
        if($status=='listings') $menu='menu_config_buying';
        if($status=='rentals') $menu='menu_config_tenant';
        if($status=='sold') $menu='menu_config_selling';
        if($status=='leased') $menu='menu_config_tenant';
        
		$data['menu_config'] = $this->$menu;
		$this->ci->template->load('default', 'property/profile', $data);
	}
	public function loadPropertyError($data = array())
	{	
        $data['menu_config'] = $this->menu_config_home;
		$this->ci->template->load('default', 'error', $data);
	}
    
}
